package com.example.zhouj.myapplication;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.example.zhouj.NsUri;

import okhttp3.Call;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        OkHttpUtils.get().url("http://www.baidu.com").build().execute(new StringCallback() {
//            @Override
//            public void onError(Call call, Exception e, int id) {
//                            if (BuildConfig.DEBUG) Log.d("MainActivity", e.toString());
//            }
//
//            @Override
//            public void onResponse(String response, int id) {
//                    if (BuildConfig.DEBUG) Log.d("MainActivity", response);
//            }
//
//        });

        NsUri.get("http://www.baidu.com", new NsUri.MyCallBack() {
            @Override
            public void ok(String data) {
                    if (BuildConfig.DEBUG) Log.d("MainActivity", data);
            }

            @Override
            public void error(Call call, Exception e, int id) {
                if (BuildConfig.DEBUG) Log.d("MainActivity", e.toString());
            }
        });
    }




}
